#!/bin/bash
cd /usr/lib/
content=`cat /etc/yum.repos.d/bigtop.repo| grep baseurl | grep -v '#'`
baseurl=${content#*=}
path="phoenix/noarch/phoenix-queryserver-6.0.0-bin.tar.gz"
url=${baseurl}${path}
echo $url
wget $url
sleep 3
pwd
chmod 777 phoenix-queryserver-6.0.0-bin.tar.gz
tar -zxvf phoenix-queryserver-6.0.0-bin.tar.gz
sleep 3
chmod -R 777 phoenix-queryserver-6.0.0
cd phoenix-queryserver-6.0.0
cp bin/phoenix_queryserver_utils.py bin/queryserver.py bin/sqlline-thin.py /usr/lib/phoenix/bin/
cp -r lib/ maven/ phoenix-queryserver-* /usr/lib/phoenix
chmod -R 777 /usr/lib/phoenix
sleep 3
